class formatDate {
	constructor() {}
	getDate() {
		const now = new Date();
		// 获取当前年份、月份（注意月份是从0开始的，所以要+1）、日期
		const year = now.getFullYear();
		const month = String(now.getMonth() + 1).padStart(2, "0");
		const date = String(now.getDate()).padStart(2, "0");
		const hours = String(now.getHours()).padStart(2, "0"); // 小时（24小时制）
		const minutes = String(now.getMinutes()).padStart(2, "0"); // 分钟

		// 拼接字符串
		return `${year}-${month}-${date} ${hours}:${minutes}`;
	}
}
module.exports = {
	formatDate
}